<template>
    <el-row>
        <el-form inline>
            <itemInput label="用户名称" v-model="form.user_name" labelWidth="70px" v-hasPerm="['system:user:list']"/>
            <itemSwitch label="用户状态" v-model="form.status" labelWidth="70px" v-hasPerm="['system:user:list']"/>
            <itemDaterange label="用户状态" v-model:start_time="form.begin_time" v-model:end_time="form.end_time" labelWidth="70px" v-hasPerm="['system:user:list']"/>
            <el-form-item>
                <el-button
                    type="primary"
                    v-hasPerm="['system:user:list']"
                    icon="Search"
                    @click="handleQuery"
                    >搜索</el-button
                >
                <el-button
                    type="default"
                    icon="Plus"
                    v-hasPerm="['system:user:add']"
                    @click="handleCreate"
                    >添加</el-button
                >
            </el-form-item>
        </el-form>
    </el-row>
</template>
<script>
import itemInput from '@/components/form/item.input.vue'
import itemSwitch from '@/components/form/item.switch.vue'
import itemDaterange from '@/components/form/item.daterange.vue'
export default {
    emits: ["search","create"],
    data(){
        return {
            form:{
                status: 1,
            },
        }
    },
    methods:{
        // 搜索事件
        handleQuery(){
            this.$emit("search",this.form)
        },
        // 添加按钮事件
        handleCreate(){
            this.$emit("create","")
        },
    },
    mounted(){
    },
    components: {
        itemInput,
        itemSwitch,
        itemDaterange,
    },
}
</script>